.TH "Image handling" 3spotify "Wed May 23 2012" "libspotify" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Image handling \- 
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef void \fBimage_loaded_cb\fP (\fBsp_image\fP *image, void *userdata)"
.br
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBsp_imageformat\fP { \fBSP_IMAGE_FORMAT_UNKNOWN\fP =  -1, \fBSP_IMAGE_FORMAT_JPEG\fP =  0 }"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "\fBsp_image\fP * \fBsp_image_create\fP (\fBsp_session\fP *session, const byte image_id[20])"
.br
.ti -1c
.RI "\fBsp_image\fP * \fBsp_image_create_from_link\fP (\fBsp_session\fP *session, \fBsp_link\fP *l)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_image_add_load_callback\fP (\fBsp_image\fP *image, \fBimage_loaded_cb\fP *callback, void *userdata)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_image_remove_load_callback\fP (\fBsp_image\fP *image, \fBimage_loaded_cb\fP *callback, void *userdata)"
.br
.ti -1c
.RI "bool \fBsp_image_is_loaded\fP (\fBsp_image\fP *image)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_image_error\fP (\fBsp_image\fP *image)"
.br
.ti -1c
.RI "\fBsp_imageformat\fP \fBsp_image_format\fP (\fBsp_image\fP *image)"
.br
.ti -1c
.RI "const void * \fBsp_image_data\fP (\fBsp_image\fP *image, size_t *data_size)"
.br
.ti -1c
.RI "const byte * \fBsp_image_image_id\fP (\fBsp_image\fP *image)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_image_add_ref\fP (\fBsp_image\fP *image)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_image_release\fP (\fBsp_image\fP *image)"
.br
.in -1c
.SH "Typedef Documentation"
.PP 
.SS "typedef void \fBimage_loaded_cb\fP(\fBsp_image\fP *image, void *userdata)"
The type of a callback used to notify the application that an image is done loading\&. 
.SH "Enumeration Type Documentation"
.PP 
.SS "enum \fBsp_imageformat\fP"
Image format 
.PP
\fBEnumerator: \fP
.in +1c
.TP
\fB\fISP_IMAGE_FORMAT_UNKNOWN \fP\fP
Unknown image format\&. 
.TP
\fB\fISP_IMAGE_FORMAT_JPEG \fP\fP
JPEG image\&. 
.SH "Function Documentation"
.PP 
.SS "\fBsp_error\fP \fBsp_image_add_load_callback\fP (\fBsp_image\fP *image, \fBimage_loaded_cb\fP *callback, void *userdata)"
Add a callback that will be invoked when the image is loaded
.PP
If an image is loaded, and loading fails, the image will behave like an empty image\&.
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object 
.br
\fIcallback\fP Callback that will be called when image has been fetched\&. 
.br
\fIuserdata\fP Opaque pointer passed to \fCcallback\fP 
.RE
.PP

.SS "\fBsp_error\fP \fBsp_image_add_ref\fP (\fBsp_image\fP *image)"
Increase the reference count of an image
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image object 
.RE
.PP
\fBReturns:\fP
.RS 4
One of the following errors, from \fBsp_error\fP SP_ERROR_OK 
.RE
.PP

.SS "\fBsp_image\fP* \fBsp_image_create\fP (\fBsp_session\fP *session, const byteimage_id[20])"
Create an image object
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP Session 
.br
\fIimage_id\fP Spotify image ID
.RE
.PP
\fBReturns:\fP
.RS 4
Pointer to an image object\&. To free the object, use \fBsp_image_release()\fP
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsp_album_cover\fP 
.PP
\fBsp_artistbrowse_portrait\fP 
.RE
.PP

.SS "\fBsp_image\fP* \fBsp_image_create_from_link\fP (\fBsp_session\fP *session, \fBsp_link\fP *l)"
Create an image object from a link
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP Session 
.br
\fIl\fP Spotify link object\&. This must be of SP_LINKTYPE_IMAGE type
.RE
.PP
\fBReturns:\fP
.RS 4
Pointer to an image object\&. To free the object, use \fBsp_image_release()\fP
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsp_image_create\fP 
.RE
.PP

.SS "const void* \fBsp_image_data\fP (\fBsp_image\fP *image, size_t *data_size)"
Get image data
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object 
.br
\fIdata_size\fP Size of raw image data
.RE
.PP
\fBReturns:\fP
.RS 4
Pointer to raw image data 
.RE
.PP

.SS "\fBsp_error\fP \fBsp_image_error\fP (\fBsp_image\fP *image)"
Check if image retrieval returned an error code\&.
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object
.RE
.PP
\fBReturns:\fP
.RS 4
One of the following errors, from \fBsp_error\fP SP_ERROR_OK SP_ERROR_IS_LOADING SP_ERROR_OTHER_PERMANENT SP_ERROR_OTHER_TRANSIENT 
.RE
.PP

.SS "\fBsp_imageformat\fP \fBsp_image_format\fP (\fBsp_image\fP *image)"
Get image format
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object
.RE
.PP
\fBReturns:\fP
.RS 4
Image format as described by sp_imageformat 
.RE
.PP

.SS "const byte* \fBsp_image_image_id\fP (\fBsp_image\fP *image)"
Get image ID
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object
.RE
.PP
\fBReturns:\fP
.RS 4
Image ID 
.RE
.PP

.SS "bool \fBsp_image_is_loaded\fP (\fBsp_image\fP *image)"
Check if an image is loaded\&. Before the image is loaded, the rest of the methods will behave as if the image is empty\&.
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object
.RE
.PP
\fBReturns:\fP
.RS 4
True if image is loaded, false otherwise 
.RE
.PP

.SS "\fBsp_error\fP \fBsp_image_release\fP (\fBsp_image\fP *image)"
Decrease the reference count of an image
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP The image object 
.RE
.PP
\fBReturns:\fP
.RS 4
One of the following errors, from \fBsp_error\fP SP_ERROR_OK 
.RE
.PP

.SS "\fBsp_error\fP \fBsp_image_remove_load_callback\fP (\fBsp_image\fP *image, \fBimage_loaded_cb\fP *callback, void *userdata)"
Remove an image load callback previously added with \fBsp_image_add_load_callback()\fP
.PP
\fBParameters:\fP
.RS 4
\fIimage\fP Image object 
.br
\fIcallback\fP Callback that will not be called when image has been fetched\&. 
.br
\fIuserdata\fP Opaque pointer passed to \fCcallback\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
One of the following errors, from \fBsp_error\fP SP_ERROR_OK 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for libspotify from the source code\&.
